<template>
  <div id="app" v-cloak>
    <!--主页面-->
    <headerBar v-if="isMain"></headerBar>
    <main class="clearfix" v-if="isMain">
      <asideBar></asideBar>
      <div class="container">
        <router-view />
      </div>
    </main>
    <!--其他页-->
    <div class="separate" v-else>
      <router-view  />
    </div>
    <!--尾部-->
    <!-- <footer>
      <a href="https://beian.miit.gov.cn" target="_blank"
        >© 2023 qiqiang.net 浙ICP备19038329号-1</a
      >
    </footer> -->
  </div>
</template>

<script>
import headerBar from "@/components/headerBar";
import asideBar from "@/components/asideBar";
import { requestApiPost } from "./api/api";
import { reqRep } from "./report/reqReport";
import { resRep } from "./report/resReport";
export default {
  name: "App",
  data() {
    return {
      isMain: false,
    };
  },
  methods: {
    getData() {
      var reqData = {
        idCard: "",
        isProcess: "0",
        current: "1",
        pageSize: "999",
        inOutJobStatus: "0",
      };
      let reqReport = reqRep({ traCode: "_LIST_AUDIT", data: reqData });
      requestApiPost(reqReport).then((data) => {
        let resReport = resRep(data);
        if (resReport.getReCode() != "0000") {
          this.$message({
            message: resReport.getReMsg(),
            type: "error",
          });
        } else {
          let total = parseInt(resReport.data.total);
          this.$store.commit("changeAudit", total);
        }
      });
    },
  },
  components: {
    headerBar,
    asideBar,
  },
  watch: {
    $route(to, from) {
      if (
        to.path == "/login" ||
        to.path == "/register" ||
        to.path == "/forgetPassword"
      ) {
        this.isMain = false;
      } else {
        this.isMain = true;
      }
    },
  },
  // mounted() {
  //   if (
  //     sessionStorage.getItem("KEY") === "A" ||
  //     sessionStorage.getItem("KEY") === "C"
  //   ) {
  //     //每1分钟调用一次审核
  //     setInterval(() => {
  //      this.getData();
  //     }, 60 * 1000);
  //   }
  // },
};
</script>

<style>
html {
  overflow-y: scroll;
}
html,
body,
#app {
  /* height: 100%; */
  background-color: #f3f7f9;
}
main {
  min-width: 1200px;
  width: 100%;
  min-height: calc(100vh - 120px);
  padding: 20px 30px 0;
  margin: 0 auto;
  box-sizing: border-box;
}

.container {
  float: right;
  width: 90%;
  min-width: 970px;
  /* min-height: 756px; */
  min-height: 610px;
  padding: 0 15px;
  box-sizing: border-box;
  border-radius: 4px;
  background-color: #fff;
  /* box-shadow: 0 2px 12px 0 rgba(0,0,0,.1); */
  box-shadow: 0 1px 3px 0 rgba(57, 79, 90, 0.06);
}
footer {
  position: absolute;
  left: 0;
  right: 0;
  margin-bottom: 0;
  height: 60px;
  line-height: 60px;
  font-size: 12px;
  color: #999;
  text-align: center;
}
footer a {
  color: #999;
}
</style>
